//
// Created by zengao on 2023/1/2.
//

#include <cstdarg>
#include <iostream>
#include "Diag.h"

using namespace C100;
namespace C100{
    void diagE(std::string_view code, int line, int col, const char *fmt, ...) {
        va_list ap;
        va_start(ap,fmt);

        std::cerr << code << std::endl;
        fprintf(stderr,"%*s^ ",col,"");
        vfprintf(stderr,fmt,ap);
        fprintf(stderr,"\n");
        va_end(ap);
        exit(0);
    }
}

